package com.cskaoyan.javase.reflect;

/**
 * 被作为反射操作的对象
 *
 * @since 10:49
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Person {
    private int age;
    public String name;
    String gender;

    Person() {
    }

    private Person(String name) {
        this.name = name;
    }

    public Person(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public Person(int age, String name, String gender) {
        this.age = age;
        this.name = name;
        this.gender = gender;
    }

    public void eat() {
        System.out.println("我今天就想吃一个鸡杂面！");
    }

    private void eat(String food) {
        System.out.println("我今天就想吃一个" + food);
    }

    public void eat(String[] foods) {
        System.out.println("今天和女神一起去吃饭!");
        for (String food : foods) {
            System.out.println("今天和他一起吃了" + food);
        }
    }

    void sleep() {
        System.out.println("今晚我要睡到明天12点!");
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Person{");
        sb.append("age=").append(age);
        sb.append(", name='").append(name).append('\'');
        sb.append(", gender='").append(gender).append('\'');
        sb.append('}');
        return sb.toString();
    }
}